﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Text;
using Microsoft.VisualStudio.Shell;
using QuestSoftware.PowerGUIVsx;

namespace PowerGuiVsx.Module
{
    public abstract class PowerGuiVsxCommand : PSCmdlet
    {
        public static void Intialize(IPowerGUIVsxPackage package)
        {
            Package = package;
        }

        protected static IPowerGUIVsxPackage Package { get; private set; }

        public void WriteError(string error)
        {
            WriteError(new ErrorRecord(new Exception(error), String.Empty, ErrorCategory.NotSpecified, null));
        }

        public void WriteError(Exception error)
        {
            WriteError(new ErrorRecord(error, String.Empty, ErrorCategory.NotSpecified, null));
        }
    }
}
